package MapList;

import java.sql.SQLOutput;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapList {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<>();
        map.put("孙悟空", "人工智能");
        map.put("数据库老师", "数据库原理");
        map.put("算法老师", "算法设计与分析");

        Set<String> strings = map.keySet();
        for (String str : strings) {
            String value = map.get(str);
            System.err.println("key = " + str + " value = " + value);
        }

        for (String str : strings) {
            if ("算法设计与分析".equals(map.get(str)))
                System.out.println(str);
        }
    }
}
